package com.oracle.dao.impl;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class LogProx implements InvocationHandler {
	private Object target;
	public LogProx(Object target){
		this.target = target;
	}
	private void logStart(){
		System.out.println("log start....");
	}
	private void logEnd(){
		System.out.println("log end....");
	}
	@Override
	public Object invoke(Object arg0, Method arg1, Object[] arg2)
			throws Throwable {
		logStart();
		Object obj = arg1.invoke(target, arg2);
		logEnd();
		return obj;
	}

}
